#include<bits/stdc++.h>
using namespace std;
#define A 100005
#define ll long long
int n,a[A],b[A],c[A],k=1,s,m;
int main(){
    freopen("duel.in","r",stdin);
    freopen("duel.out","w",stdout);
    cin>>n;
    for(int i=1;i<=n;i++){
        cin>>a[i];
        m=max(a[i],m);
    }
    for(int i=1;i<=n;i++){
        b[a[i]]++;
    }
    for(int i=1;i<=m;i++){
        if(b[i]!=0){
            c[k]=i;
            k++;
        }
    }
    for(int i=2;i<=k+1;i+=2){
        if(i<=k+1){
            if(b[c[i-1]]<=b[c[i]]){
                b[c[i-1]]=0;
            }
            else{
                s+=b[c[i]];
                b[c[i]]=b[c[i-1]]-b[c[i]];
                b[c[i-1]]=0;
            }
        }
    }
    for(int i=1;i<=m+1;i++){
        if(b[i]!=0){
            s+=b[i];
        }
    }
    cout<<s;
    fclose(stdin);
    fclose(stdout);
    return 0;
}
